package toubiao.domain.po.business;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;















import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "`select`") //对应保存的数据库名称
@DynamicUpdate(true)	
public class PoSelect {

	private int id;
	
	//目前2种：全局global;class 和类有关系的
	private String type;
	
	private String className;
	
	private String classFieldName;
	
	//备注
	private String comment;
	
	private Set<PoSelectOption> selectOptionSet=new HashSet<>();

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID")
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	
	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public String getClassFieldName() {
		return classFieldName;
	}

	public void setClassFieldName(String classFieldName) {
		this.classFieldName = classFieldName;
	}

	@OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.ALL})
	@JoinColumn(name="select_id")
	/*@org.hibernate.annotations.IndexColumn(name = "option_position",base = 1)*/
	public Set<PoSelectOption> getSelectOptionSet() {
		return selectOptionSet;
	}

	public void setSelectOptionSet(Set<PoSelectOption> selectOptionSet) {
		this.selectOptionSet = selectOptionSet;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}
	
	
}
